import java.io.File;

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.util.AutoIRIMapper;

import junit.framework.TestCase;

public class OntologyLoaderFromURL extends TestCase {
	
	public static final IRI routing_iri = IRI
	.create("https://owl-test.googlecode.com/svn/trunk/ontology/RoutingModel.owl");
	
	//public static final IRI example_iri = IRI
	//.create("http://www.semanticweb.org/ontologies/ont.owl");
	
	OWLDataFactory df = OWLManager.getOWLDataFactory();
	
	public static OWLOntologyManager create() {
		OWLOntologyManager m =
		OWLManager.createOWLOntologyManager();
		m.addIRIMapper(new AutoIRIMapper(
		new File("materializedOntologies"), true));
		return m;
	}
	
	
	public static void main(String[] args) throws OWLOntologyCreationException
	{
		OWLOntologyManager m = create();
		OWLOntology o = m.loadOntologyFromOntologyDocument(routing_iri);
		System.out.println(o);
		assertNotNull(o);
		
	}
	
}